<!DOCTYPE html>
<html>
 
<head>
    <meta charset="UTF-8">
    <title>输出数组长度</title>
</head>
<body>
    <script>
        let arr = [];
        let length = 5;
        for (let i = 0; i < length; i++) {
            arr[i] = prompt("请输入第" + (i + 1) + "个同学分数");
        }
        for (let i = 0; i < arr.length; i++) {
            console.log("第" + (i + 1) + "个同学的分数是：" + arr[i]);
        }
        console.log("数组长度为" + length);
    </script>
</body>
</html>